<!-- <script lang="ts">
import { defineComponent, h } from "vue";
import { NModal } from "naive-ui";

export default {
  components: {
    NModal,
  },
  props: {
    show: {
      type: Boolean,
      default: true,
    },
    title: {
      type: String,
      default: "",
    },
  },
  mounted() {
    this.isShow = true;
  },
  data() {
    return {
      isShow: false,
      message: "11111",
    };
  },
  methods: {
    afterLeave() {
      this.$emit("close");
    },
  },
  render() {
    // const state = reatcive({
    //   isShow: true,
    // })
    // const props = {
    //   show: this.$props.show,
    //   preset: "dialog",
    //   title: "Dialog",
    // };
    const openHandle = (event: boolean) => {
      console.log("点击===", event);
      this.isShow = false;
      // this.$emit("close");
      // this.$emit("")
      // emit("update:show", event);
      // showModal.value = true;
      // props.show;
    };
    const testClick = () => {
      console.log("测试按钮点击");
      this.message = "22222";
      this.$emit("change");
    };
    console.log("=======render 函数===");
    return h(
      "div",
      {
        className: "render",
      },
      h(
        NModal,
        {
          show: this.isShow,
          title: this.title,
          preset: "dialog",
          "onUpdate:show": openHandle,
          "on-after-leave": this.afterLeave,
        },
        {
          default: () =>
            h("div", null, [
              h("button", { onClick: testClick }, "测试"),
              h("div", null, this.$props.title),
              h("div", null, this.message),
            ]),
        }
      )
    );
  },
};
</script>

<style scoped lang="less"></style> -->
